package com.tianruan.dc.modules.sys.user.mapper;

import com.tianruan.dc.modules.sys.user.entity.dto.ConsultationDTO;
import com.tianruan.dc.modules.sys.user.entity.dto.TutorSolutionDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TutorSolutionMapper {

    /**
     * 新增解答
     *
     * @param tutorSolutionDTO
     * @return
     */
    void insert(TutorSolutionDTO tutorSolutionDTO);

    /**
     * 删除解答
     * @param tutorSolutionDTO
     */
    @Delete("delete from ipa.t_ipa_consultation_solution where id = #{id}")
    void delete(TutorSolutionDTO tutorSolutionDTO);

    /**
     * 根据主键查询解答
     * @param id
     * @return
     */
    @Select("select * from ipa.t_ipa_consultation_solution where id = #{id}")
    TutorSolutionDTO getbyid(String id);

    /**
     * 修改解答
     * @param tutorSolutionDTO
     */
    void update(TutorSolutionDTO tutorSolutionDTO);

    /**
     *根据咨询id查询该咨询下所有解答
     * @param id
     * @return
     */
    List<ConsultationDTO> selectSolution(String id);

}
